import React, { useRef } from 'react'
import Input from './Input'

export default function ImpeCom() {
  //创建 ref 对象
  let ref = useRef();
  return (
    <div>
      <button onClick={() => {
        ref.current.focus();
      }}>获得焦点</button>
      <hr />
      <Input ref={ref} />
    </div>
  )
}
